package com.itlong.cloud.user.property;

import com.itlong.cloud.POJO.DTO.property.PropertyFunctionGetPageDTO;
import com.itlong.cloud.POJO.PO.PropertyFunctionPO;
import com.itlong.cloud.POJO.VO.property.PropertyFunctionVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      物业-资源菜单业务处理暴露接口
 * </desc>
 *
 * @createDate 2017/09/21
 */
@FeignClient(name = "user-service")
public interface IPropertyFunctionServiceClient {
    /**
     * <desc>
     *      获取分页列表
     * </desc>
     *
     * @param propertyFunctionGetPageDTO 查询参数DTO
     * @return page模型
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/getPage")
    Page<PropertyFunctionPO> getPage(@RequestBody PropertyFunctionGetPageDTO propertyFunctionGetPageDTO) throws Exception;

    /**
     * <desc>
     *      保存资源
     * </desc>
     *
     * @param propertyFunctionPO 资源实体
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/save")
    Integer save(@RequestBody PropertyFunctionPO propertyFunctionPO) throws Exception;

    /**
     * <desc>
     *      更新资源
     * </desc>
     *
     * @param propertyFunctionPO 资源实体
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/update")
    Integer update(@RequestBody PropertyFunctionPO propertyFunctionPO) throws Exception;

    /**
     * <desc>
     *      查询单条资源
     * </desc>
     *
     * @param propertyFunctionPO 资源实体
     * @return 资源实体
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/getOne")
    PropertyFunctionPO getOne(@RequestBody PropertyFunctionPO propertyFunctionPO);

    /**
     * <desc>
     *      删除资源
     * </desc>
     *
     * @param functionIds 资源id数组
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/delete")
    Integer delete(@RequestParam("functionIds") String functionIds);

    /**
     * <desc>
     *      获取子节点
     * </desc>
     *
     * @param functionId 资源id
     * @return 子级结果集
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/property/system/function/getChilds")
    List<PropertyFunctionVO> getChilds(@RequestParam("functionId") String functionId);


    /**
     * <desc>
     *      获取分配菜单所有节点
     * </desc>
     *
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/26
     */
    @RequestMapping(path = "/property/system/function/getAllotFunction")
    public List<PropertyFunctionVO> getAllotFunction(@RequestParam("roleId") String roleId,@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      通过角色id及项目id获取该角色拥有的所有节点ID
     * </desc>
     *
     * @param roleId 角色id
     * @param projectId 项目id
     * @return
     * @author Chunjian.G
     * @createDate 2018-01-15
     */
    @RequestMapping(path = "/property/system/function/getFunctionIdsByRoleProject")
    List<String> getFunctionIdsByRoleProject(@RequestParam("roleId") String roleId,
                                             @RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取当前节点的父级节点以及同级别所有父级节点
     * </desc>
     *
     * @param parent 资源id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/property/system/function/getParentLevelFunctions")
    public List<PropertyFunctionPO> getParentLevelFunctions(@RequestParam("parent") String parent);

    /**
     * <desc>
     *      更新1.6角色权限
     * </desc>
     *
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/property/system/function/handleV16FunctionUpdate")
    public Boolean handleV16FunctionUpdate();

    /**
     * <desc>
     *      获取套餐功能
     * </desc>
     *
     * @param propertyPackageId 物业套餐id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/25
     */
    @PostMapping("/operate/packageManage/propertyPackage/getPackageFunction")
    List<PropertyFunctionVO> getPackageFunction(@RequestParam("propertyPackageId") String propertyPackageId) throws Exception;
}
